/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Objects;

/**
 *
 * @author Pham
 */
public class DTOManufacture {
    private int manuID;
    private String manuName;
    
    //accessors
    public int getManuID() {
        return manuID;
    }

    public void setManuID(int manuID) {
        this.manuID = manuID;
    }
    
    public String getManuName() {
        return manuName;
    }

    public void setManuName(String manuName) {
        this.manuName = manuName;
    }
    
    //contructors
    public DTOManufacture()
    {
        
    }
    
    public DTOManufacture(ResultSet rs) throws SQLException
    {
        this.manuID = rs.getInt("manufacture_id");
        this.manuName = rs.getString("manufacture_name");
    }
    
    @Override
    public String toString() {
        return manuName;
    }
    
    @Override
    public boolean equals(Object obj){
        if(obj instanceof DTOManufacture){
            DTOManufacture dtoManu = (DTOManufacture)obj;
            return dtoManu.manuName.equals(this.manuName);
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 47 * hash + Objects.hashCode(this.manuName);
        return hash;
    }
}
